package io.kiki.sba.registry.compress;

import io.kiki.sba.registry.cache.Sizer;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class CompressedItem implements Sizer {
    private final byte[] compressedBytes;
    private final int originSize;
    private final String encoding;

    public CompressedItem(byte[] compressedBytes, int originSize, String encoding) {
        this.compressedBytes = compressedBytes;
        this.originSize = originSize;
        this.encoding = encoding;
    }

    @Override
    public int size() {
        return compressedBytes.length + 16 + encoding.length();
    }

}
